
import { View } from '@tarojs/components'
import { AtGrid } from "taro-ui"
import Taro from '@tarojs/taro'

interface DateList{
    image: string,
    value: string,
    path: string
}

function Nav() {
    const data:Array<DateList> = [
        {
            image: 'https://img12.360buyimg.com/jdphoto/s72x72_jfs/t6160/14/2008729947/2754/7d512a86/595c3aeeNa89ddf71.png',
            value: '图片',
            path: '/pages/Picture/index'
        },
        {
            image: 'https://img20.360buyimg.com/jdphoto/s72x72_jfs/t15151/308/1012305375/2300/536ee6ef/5a411466N040a074b.png',
            value: '新闻',
            path: '/pages/News/index'
        },

    ]

    const toDetail = (e: DateList) => {
        Taro.navigateTo({
            url: e.path
        });

    }

    return (
        <View className='nav'>
            <AtGrid mode='rect' hasBorder={false} data={data} onClick={toDetail} />
        </View>)



}

export default Nav